package com.dtstack.rocketmq.listener;

import com.google.common.eventbus.AsyncEventBus;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.Executors;

/**
 * EventBusConfig
 *
 * <p>
 *     配置EventBus：创建一个配置类来初始化EventBus。你可以使用AsyncEventBus来异步处理事件。
 * </p>
 *
 * @author chuanbai
 * @date 2024/11/11
 */
@Configuration
public class EventBusConfig {
    @Bean
    public AsyncEventBus asyncEventBus() {
        return new AsyncEventBus(Executors.newCachedThreadPool());
    }
}